package com.onpositive.mediawiki.dataminer;


import org.eclipse.jface.dialogs.Dialog;

import com.onpositive.commons.xml.language.DOMEvaluator;
import com.onpositive.dataminer.core.DataProviderConfig;
import com.onpositive.dataminer.core.IDataProviderConfigurator;
import com.onpositive.semantic.model.binding.Binding;
import com.onpositive.semantic.model.ui.generic.IDisplayable;

public class MediaWikiConfigurator implements IDataProviderConfigurator {

	public MediaWikiConfigurator() {
	}

	@Override
	public boolean configure(DataProviderConfig config) {
		try {
			Binding pContext = new Binding(config);
			IDisplayable r = (IDisplayable) DOMEvaluator.getInstance()
					.evaluateLocalPluginResource(MediaWikiDataProvider.class,
							"config.dlf", pContext);
			int openWidget = r.openWidget();
			return openWidget == Dialog.OK;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return true;
	}

}
